import { PromiseData } from '@/@types/request'
import request, { OperateData } from '@/utils/request'
import { TableData } from './data'

// 查询列表
export const getTableList = (data: any): Promise<PromiseData<TableData>> =>
  request.post('/wardManage/getOrganization', data)

// 添加修改病区
export const updateWard = (data: {
  id?: number
  fatherId?: number
  unit: string
  code?: number
}): Promise<PromiseData<OperateData>> => request.post('/wardManage/saveOrUpdateWard', data)

// 删除病区
export const deleteWard = (data: { id: number }): Promise<PromiseData<OperateData>> =>
  request.post('/wardManage/deleteWard', data)
